<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
  xmlns:camunda="http://camunda.org/schema/1.0/bpmn"
  targetNamespace="Examples">
  
  <escalation id="escalation" name="escalation" escalationCode="escalationCode" />

  <process id="escalationProcess" isExecutable="true">
  
  <startEvent id="start" />
  
  <sequenceFlow sourceRef="start" targetRef="subProcess" />
    
  <subProcess id="subProcess">
  
    <multiInstanceLoopCharacteristics isSequential="false">
      <loopCardinality>5</loopCardinality>
    </multiInstanceLoopCharacteristics>
    
    <startEvent id="startSubProcess" />
   
    <sequenceFlow sourceRef="startSubProcess" targetRef="escalationThrowingEvent" />
   
    <intermediateThrowEvent id="escalationThrowingEvent">
      <escalationEventDefinition escalationRef="escalation" />
    </intermediateThrowEvent>
    
    <sequenceFlow sourceRef="escalationThrowingEvent" targetRef="taskInSubprocess" />
    
    <userTask id="taskInSubprocess" name="task in subprocess" />
    
    <sequenceFlow sourceRef="taskInSubprocess" targetRef="endSubProcess" />
   
    <endEvent id="endSubProcess" />
   
   </subProcess>
  
  <sequenceFlow sourceRef="subProcess" targetRef="theEnd" />
  
  <endEvent id="theEnd" />
 
  <subProcess id="escalationEventSubprocess" triggeredByEvent="true">
      
    <startEvent id="escalationStartEvent" isInterrupting="false">
      <escalationEventDefinition escalationRef="escalation" />
    </startEvent>
    
    <sequenceFlow sourceRef="escalationStartEvent" targetRef="taskAfterCatchedEscalation" />

    <userTask id="taskAfterCatchedEscalation" name="task after catched escalation" />
    
    <sequenceFlow sourceRef="taskAfterCatchedEscalation" targetRef="endInEscalationSubprocess" />
    
    <endEvent id="endInEscalationSubprocess" />
      
    </subProcess>
  
  </process>

</definitions>
